package com.mlethe.library.socialtool.core;

import androidx.annotation.Nullable;

/**
 * 网络请求异常
 * @author Mlethe
 */
class HttpException extends Exception {
    private int code;

    public HttpException(int code) {
        this.code = code;
    }

    public HttpException(int code, String message) {
        super(message);
        this.code = code;
    }

    @Nullable
    @Override
    public String getMessage() {
        String message = super.getMessage();
        if (message == null) {
            return "[" + code + "]";
        } else {
            return "[" + code + "]" + message;
        }
    }

}
